package org.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 考勤规则表
 * @TableName attendance_rule
 */
@TableName(value ="attendance_rule")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AttendanceRule {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer ruleId;

    /**
     * 
     */
    private String ruleName;

    /**
     * 
     */
    private Object ruleType;

    /**
     * 
     */
    private Integer targetId;

    /**
     * 
     */
    private Object workDays;

    /**
     * 
     */
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date workStart;

    /**
     * 
     */
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date workEnd;

    /**
     * 
     */
    private Integer lateTolerance;

    /**
     * 
     */
    private Integer earlyLeaveTolerance;

    /**
     * 
     */
    private Integer maxRemote;

    /**
     * 
     */
    private Integer maxPatch;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effectiveDate;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date expirationDate;

    /**
     * 
     */
    private Object isActive;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdAt;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedAt;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AttendanceRule other = (AttendanceRule) that;
        return (this.getRuleId() == null ? other.getRuleId() == null : this.getRuleId().equals(other.getRuleId()))
            && (this.getRuleName() == null ? other.getRuleName() == null : this.getRuleName().equals(other.getRuleName()))
            && (this.getRuleType() == null ? other.getRuleType() == null : this.getRuleType().equals(other.getRuleType()))
            && (this.getTargetId() == null ? other.getTargetId() == null : this.getTargetId().equals(other.getTargetId()))
            && (this.getWorkDays() == null ? other.getWorkDays() == null : this.getWorkDays().equals(other.getWorkDays()))
            && (this.getWorkStart() == null ? other.getWorkStart() == null : this.getWorkStart().equals(other.getWorkStart()))
            && (this.getWorkEnd() == null ? other.getWorkEnd() == null : this.getWorkEnd().equals(other.getWorkEnd()))
            && (this.getLateTolerance() == null ? other.getLateTolerance() == null : this.getLateTolerance().equals(other.getLateTolerance()))
            && (this.getEarlyLeaveTolerance() == null ? other.getEarlyLeaveTolerance() == null : this.getEarlyLeaveTolerance().equals(other.getEarlyLeaveTolerance()))
            && (this.getMaxRemote() == null ? other.getMaxRemote() == null : this.getMaxRemote().equals(other.getMaxRemote()))
            && (this.getMaxPatch() == null ? other.getMaxPatch() == null : this.getMaxPatch().equals(other.getMaxPatch()))
            && (this.getEffectiveDate() == null ? other.getEffectiveDate() == null : this.getEffectiveDate().equals(other.getEffectiveDate()))
            && (this.getExpirationDate() == null ? other.getExpirationDate() == null : this.getExpirationDate().equals(other.getExpirationDate()))
            && (this.getIsActive() == null ? other.getIsActive() == null : this.getIsActive().equals(other.getIsActive()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRuleId() == null) ? 0 : getRuleId().hashCode());
        result = prime * result + ((getRuleName() == null) ? 0 : getRuleName().hashCode());
        result = prime * result + ((getRuleType() == null) ? 0 : getRuleType().hashCode());
        result = prime * result + ((getTargetId() == null) ? 0 : getTargetId().hashCode());
        result = prime * result + ((getWorkDays() == null) ? 0 : getWorkDays().hashCode());
        result = prime * result + ((getWorkStart() == null) ? 0 : getWorkStart().hashCode());
        result = prime * result + ((getWorkEnd() == null) ? 0 : getWorkEnd().hashCode());
        result = prime * result + ((getLateTolerance() == null) ? 0 : getLateTolerance().hashCode());
        result = prime * result + ((getEarlyLeaveTolerance() == null) ? 0 : getEarlyLeaveTolerance().hashCode());
        result = prime * result + ((getMaxRemote() == null) ? 0 : getMaxRemote().hashCode());
        result = prime * result + ((getMaxPatch() == null) ? 0 : getMaxPatch().hashCode());
        result = prime * result + ((getEffectiveDate() == null) ? 0 : getEffectiveDate().hashCode());
        result = prime * result + ((getExpirationDate() == null) ? 0 : getExpirationDate().hashCode());
        result = prime * result + ((getIsActive() == null) ? 0 : getIsActive().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ruleId=").append(ruleId);
        sb.append(", ruleName=").append(ruleName);
        sb.append(", ruleType=").append(ruleType);
        sb.append(", targetId=").append(targetId);
        sb.append(", workDays=").append(workDays);
        sb.append(", workStart=").append(workStart);
        sb.append(", workEnd=").append(workEnd);
        sb.append(", lateTolerance=").append(lateTolerance);
        sb.append(", earlyLeaveTolerance=").append(earlyLeaveTolerance);
        sb.append(", maxRemote=").append(maxRemote);
        sb.append(", maxPatch=").append(maxPatch);
        sb.append(", effectiveDate=").append(effectiveDate);
        sb.append(", expirationDate=").append(expirationDate);
        sb.append(", isActive=").append(isActive);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append("]");
        return sb.toString();
    }
}